package com.demo.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.demo.entity.Bug;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author mifei
 * @create 2020-09-10 17:11
 **/
@Repository
public interface BugMapper extends BaseMapper<Bug> {

    @Select( "select b.name,a.num from `zt_product` b ,(\n" +
            "select count(1) as num,product from `zt_bug` \n" +
            "where status !='closed' and STATUS !='resolved' and deleted!='1' group by product) a \n" +
            "where b.id=a.product ")
    public List<Bug> select ();
}
